<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 父传子  子再传父  -->
    <div id="app">
        <zicpn :fuchuanzi="number" @zidingyishijian='fumethod'></zicpn>
    </div>
    <template id="zitemp">
        <div>
            {{fuchuanzi}}
            <input type="text" :value="fuchuanzi" @input='inputmethod'>
        </div>
    </template>

    <script src="../../vue.js"></script>
    <script>
        const zicpn = {
            template:'#zitemp',
            props:['fuchuanzi'],
            methods:{
                inputmethod(event){
                    console.log(event.target.value);
                    this.$emit('zidingyishijian',event.target.value)
                }
            }
        }
        new Vue({
            el:'#app',
            data:{
                number:10
            },
            components: {
             zicpn,
            },
            methods:{
                fumethod(value){
                    this.number =value
                }
            }
        })
    </script>
</body>
</html>